unit pasDateDialog;

interface

uses
  Windows,
  Messages,
  SysUtils,
  Classes,
  Graphics,
  Controls,
  Forms,
  Dialogs,
  ExtCtrls,
  StdCtrls,
  ComCtrls, TB97, TFlatButtonUnit;

type
  TfrmDateDialog = class(TForm)
    lblMessage: TLabel;
    txtValue: TDateTimePicker;
    bevSeparator: TBevel;
    procedure btnOKClick(Sender: TObject);
    procedure btnCancelClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    fValue: TDate;
  protected
    procedure WriteValue( Value: TDate );
  public
  published
    property Value: TDate read fValue write WriteValue;
  end;

var
  frmDateDialog: TfrmDateDialog;

implementation

{$R *.DFM}

procedure TfrmDateDialog.WriteValue( Value: TDate );
begin
  if fValue <> Value then
  begin
    fValue := Value;
    txtValue.Date := fValue;
  end;//if
end;

procedure TfrmDateDialog.btnOKClick(Sender: TObject);
begin
  Value := txtValue.Date;
  ModalResult := mrOK;
end;

procedure TfrmDateDialog.btnCancelClick(Sender: TObject);
begin
  Value := 0;
  ModalResult := mrCancel;
end;

procedure TfrmDateDialog.FormCreate(Sender: TObject);
begin
  if Screen.Fonts.IndexOf( 'Tahoma' ) > -1 then
  begin
    Font.Name := 'Tahoma';
    Font.Charset := EASTEUROPE_CHARSET;
  end;//if

  {
  btnOK.Font := Font;
  btnCancel.Font := Font;
  }

end;

end.
